Global options for outputs/formatting
Plain text formatting allows for conversion to multiple document types
knit button or command/CTRL-shift-KRender files in the console with rmarkdown::render(file, output_format) (this is what knit is doing)
Option to create PDF from HTML with pagedown::chrome_print(file)
\(\LaTeX\) templates (pay attention to $ in templates)
Word Document: use the Styles Pane and “Update to Match Selection”
These files go in the same place as your .Rmd
Example from my CV with both template-specific YAML parameters and YAML references
Examples of calling packages in the YAML header and using inline functions from my stats homework
Stats homework output
Examples from my Psychonomics poster
To make extremely custom edits to templates, sometimes you have to edit the template documents
# Make dataframe with installed packages
pkgs <- installed.packages() %>%
as.data.frame()
# Pull posterdown package
pstr <- pkgs %>%
select(Package, LibPath, Version, Depends, Imports) %>%
dplyr::filter(Package == "posterdown")
# Make table
kable(pstr) %>%
kable_styling(bootstrap_options = "condensed",
font_size = 18)| Package | LibPath | Version | Depends | Imports |
|---|---|---|---|---|
| posterdown | /Library/Frameworks/R.framework/Versions/3.5/Resources/library | 1.0 | NA | pagedown, rmarkdown, yaml |
Knitting the vitae::awesomecv template created a .cls file that I could edit to change font sizes/colors
:: for unloaded packages and conflicting functionsWarnings won’t stop your document from compiling, but generally indicate that you should change something in your code
Chunk error
Markdown/YAML error
Running a chunk executes the code in the console and adds the output to your R environment
Your R environment is separate from the environment created when “knitting” a document
rm(ls = list())?packageStack Overflow is your friend!
scholar package for automatically downloading citations from Google Scholardevtools package for installing packages/plug-ins from GitHub (e.g., papaja)rmarkdown) in library with update.packages(path)install.packages(package)updateR packageassign() function for dynamic variable namesggplot parameters in a list()source()%notin%